export const cache = {
  getToken: () => localStorage.getItem('employee-token'),
  setToken: (token: string) => localStorage.setItem('employee-token', token),

  getShop: () => (localStorage.getItem('employee-shop') ? JSON.parse(localStorage.getItem('employee-shop')!) : null) as ApiShop,
  setShop: (shop: ApiShop) => localStorage.setItem('employee-shop', JSON.stringify(shop)),

  getTokenExpires: () => parseInt(localStorage.getItem('employee-tokenExpires') || '0'),
  setTokenExpires: (tokenExpires: number) => localStorage.setItem('employee-tokenExpires', tokenExpires + ''),

  getRefreshToken: () => localStorage.getItem('employee-refreshToken'),
  setRefreshToken: (refreshToken: string) => localStorage.setItem('employee-refreshToken', refreshToken)
}
